package com.young.config;

import org.springframework.boot.web.server.ErrorPage;
import org.springframework.boot.web.server.WebServerFactoryCustomizer;
import org.springframework.boot.web.servlet.server.ConfigurableServletWebServerFactory;
import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Component;

import java.util.Set;
import java.util.concurrent.TimeUnit;

/**
 * @author: create by Young
 * @version: v1.0
 * @description: com.young
 * @date:2019/3/16 3:28
 */
@Component
public class WebServerConfig implements WebServerFactoryCustomizer<ConfigurableServletWebServerFactory> {

	@Override
	public void customize(ConfigurableServletWebServerFactory factory) {
		//factory.setPort(8082);
/*		factory.addErrorPages(new ErrorPage(HttpStatus.BAD_REQUEST,"/error/400"));
		factory.addErrorPages(new ErrorPage(HttpStatus.NOT_FOUND,"/error/404"));
		factory.addErrorPages(new ErrorPage(HttpStatus.INTERNAL_SERVER_ERROR,"/error/500"));
		factory.addErrorPages(new ErrorPage(java.lang.Throwable.class,"/error/500"));
	*/
	}
}
